home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
Python 1.3.3
/
stdwin
/
Ports
/
mac
/
pstring.c
< prev
next >
Wrap
Text File
|
1995-12-21
|
516b
|
26 lines
/* Function to convert a C string to a Pascal string.
The conversion is not in-line, but returns a pointer to a static buffer.
This is needed when calling some toolbox routines.
MPW does the conversion in the glue.
*/
#include "macwin.h"
#ifndef CLEVERGLUE
unsigned char *
PSTRING(src)
register char *src;
{
static Str255 buf;
register unsigned char *dst;
dst = &buf[1];
while ((*dst++ = *src++) != '\0' && dst < &buf[256])
;
buf[0] = dst - &buf[1] - 1;
return buf;
}
#endif /* CLEVERGLUE */